var o_ueditorupload = UE.getEditor('upload',{autoHeightEnabled:false});
o_ueditorupload.ready(function (){
    o_ueditorupload.hide();//隐藏编辑器
    o_ueditorupload.addListener('beforeInsertImage', function (t,arg){
		if(($('#image_item img').size() + arg.length) > 5){
			Box.alertBox('图片限制上传数目5张');
			return;
		}
		$(arg).each(function(index, element) {
			var html='';
			html += '<div class="info_frame">';
			html += 	'<div class="img"><img src="'+arg[index].src+'" width="78"></div>';
			html +=		'<div class="del">删除</div>';
			html +=		'<input type="hidden" name="PicPath[]" value="'+arg[index].src+'">';
			html += '</div>';
            $('#image_item').append(html);
        });
    });
	$('#image_item').off().on('click','.del',function(){
		var parent=$(this).parent('.info_frame');
		Box.confirmBox('您确定删除该图片？',function(){
			$(parent).remove();
		});
	});
});
function upImage(){
    var myImage = o_ueditorupload.getDialog("insertimage");
    myImage.open();
}